<?
    /* -*- Mode: PHP5; tab-width: 4; indent-tabs-mode: nil; basic-offset: 4 -*- */
    
    /*********************************************************
    *            --== InArch ==--
    *
    * Ajax Delete File
    *
    * @author Kulikov Alexey <a.kulikov@gmail.com>
    * @version n/a
    * @since 01.10.2005
    * @copyright essentialmind.com 2005
    *
    *********************************************************/

    /***
    * class ajaxDeleteFile
    ****
    * @package ajax
    * @author A Kulikov <a.kulikov@gmail.com>
    * @version n/a
    * @since 01.10.2005
    * @copyright essentialmind.com 2005
    ***/
    class ajaxAddArticleToPackage extends ajaxAction{

        public function process(){            
            if(!$this->db->getOne("SELECT article_id FROM node_shop_package_article WHERE article_id = ".(int)$_REQUEST['id']." AND package_id = ".(int)$_REQUEST['pid'])){
                $this->db->Execute("INSERT INTO node_shop_package_article(article_id, package_id) VALUES(".(int)$_REQUEST['id'].", ".(int)$_REQUEST['pid'].")");
                $this->r->added  = true;
            }
        }
    }
?>